{include file='public/meta' /}

<title>添加管理员 - 管理员管理 - H-ui.admin v3.0</title>
</head>
<body>
<article class="cl pd-20">
	<form action="" method="post" class="form form-horizontal" id="form-admin-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户名称：</label>
			<div class="formControls col-xs-7 col-sm-8">
				<input type="text" class="input-text" value="" placeholder="名称" id="username" name="username">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户密码：</label>
			<div class="formControls col-xs-7 col-sm-8">
				<input type="password" class="input-text" autocomplete="off" value="" placeholder="密码" id="password" name="password">
			</div>
		</div>
		<div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户邮箱：</label>
            <div class="formControls col-xs-7 col-sm-8">
                <input type="text" class="input-text" placeholder="@" name="email" id="email">
            </div>
        </div>

        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>厂家名称：</label>
			<div class="formControls col-xs-7 col-sm-8">
				<span class="select-box radius">
					<select class="select" name="oem" id="oem">
						<option value="">选择厂家：</option>
						{volist name="list" id="vo"}
							<option value="{$vo.name}">{$vo.name}</option>
						{/volist}
					</select>
				</span>
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">角色：</label>
			<div class="formControls col-xs-7 col-sm-8"> <span class="select-box" style="width:150px;">
				<select class="select" name="role" size="1">
					<option value="0">普通管理员</option>
                    <option value="1">超级管理员</option>
				</select>
				</span> </div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" id="submit">
			</div>
		</div>
	</form>
</article>

{include file="public/footer" /}

<script type="text/javascript">

$(function(){

    $("#submit").click(function(){
        $.ajax({
            type: "POST",
            url: "{:url('user/addUser')}",
            data: $("#form-admin-add").serialize(),
            dataType: "json",
            success: function(data){
                alert(data.message);
                if (data.status == 1) {
                    layer.close(layer.index);
                    parent.location.reload(); // 父页面刷新
                }
            }
        });
    });
	
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>